export default function topic(topic={
    loading:true,
    data:{author:{}},
    isError:false,
    msg:''
},action){

    switch (action.type) {
        case 'topic_loading':
            return{
                loading:true,
                data:{author:{}},
                isError:false,
                msg:''
            }
        case 'topic_loadover':
            return{
                loading:false,
                data:action.data,
                isError:false,
                msg:''
            }
         case 'topic_error':
             return{
                loading:false,
                data:{author:{}},
                isError:true,
                msg:action.err_msg
             }

            default:
                return topic
    }
    
  
}